<?php

namespace plug\SiteStat;
use app\common\Controller\Plug;
use think\View;

/**
 * 系统环境信息插件
 * @author thinkphp
 */
class SiteStat extends Plug{
    //实现的AdminIndex钩子方法
    public function index($_Params){
		//按钮上的数据
		$_ConsoleCount['user']		= db('User')->count();
		$_ConsoleCount['action']	= db('Action')->where(['status'=>1])->count();
		$_ConsoleCount['action_log']= db('ActionLog')->where(['create_time'=>['gt',strtotime('-30 days')]])->count();
		$_ConsoleCount['module']	= db('Module')->where(['status'=>1])->count();
		$_ConsoleCount['plug']		= db('Plug')->where(['status'=>1])->count();
        $this->assign('_ConsoleCount', $_ConsoleCount);
        $this->assign('_cfg', $this->_Cfg);
		$this->fetch('view/info');
    }
}
?>